package tbs.framework.sql.logger.impl;

import tbs.framework.log.ILogger;
import tbs.framework.log.annotations.AutoLogger;
import tbs.framework.sql.config.SqlConfig;
import tbs.framework.sql.logger.ISqlLogger;
import tbs.framework.sql.model.SqlRuntimeStatus;

/**
 * 空SQL日志器
 * @author abstergo
 */
public class NoSqlLogger implements ISqlLogger {
    private boolean hasShow=false;

    @AutoLogger(factory = SqlConfig.SQL_LOG_FACTORY_BEAN_NAME)
    private ILogger logger;
    @Override
    public void log(SqlRuntimeStatus sqlRuntimeStatus) {
        if (!hasShow) {
            hasShow = true;
            logger.warn("NoSqlLogger is running");
        }
    }
}
